/*
 * safecheck.hpp
 *
 *  Created on: 2023年2月22日
 *      Author: Jiapeng Chen
 */

#ifndef __SAFECHECK_HPP
#define __SAFECHECK_HPP

#include "system/system.hpp"
#include "userlib/userlib.hpp"

#ifdef __cplusplus
extern "C" {
#endif

#define cali_count_done 40
//机械安装误差矫正
//右偏则-，左偏则+
#define acc_mech_off1 0
#define acc_mech_off2 0

#ifdef __cplusplus
}

#endif




#ifdef __cplusplus

using namespace std;

class SAFECHECK
{
public:
	SAFECHECK(){}
	~SAFECHECK(){}

	void check();
	void calibration();

private:
	flow_msg flow;
	sensor_acc_msg  acc;
	sensor_gyro_msg gyro;
	height_msg height;

	int cali_count=0;
	float acc_cali[cali_count_done][3];
	float gyro_cali[cali_count_done][3];

	bool isSuspend=false;
	bool isInit=false;
};

#endif





#endif
/************************ (C) COPYRIGHT Longmen Drone Team *****END OF FILE****/
